package com.acyouzi.sogou;

import java.util.Arrays;
import java.util.Scanner;

/**
 * 17/9/28 19:34
 *
 * @author sunxu
 */
public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int len = in.nextInt();
    double[] arr = new double[len];
    for (int i = 0; i < len; i++) arr[i] = in.nextDouble();
    Arrays.sort(arr);
    int res = 0;
    for (int i = 0; i < len; i++) {
      int end = i + 2;
      while (end < len){
        if (arr[end] - arr[i] < 180){
          res += (end - i -1);
          end++;
        } else {
          break;
        }
      }
    }
    System.out.println(res);
  }
}
